# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.ImageProperties do
  @moduledoc """
  The properties of an image.

  ## Attributes

  *   `angle` (*type:* `number()`, *default:* `nil`) - The clockwise rotation angle of the image, in radians.
  *   `brightness` (*type:* `number()`, *default:* `nil`) - The brightness effect of the image. The value should be in the interval [-1.0, 1.0], where 0 means no effect.
  *   `contentUri` (*type:* `String.t`, *default:* `nil`) - A URI to the image with a default lifetime of 30 minutes. This URI is tagged with the account of the requester. Anyone with the URI effectively accesses the image as the original requester. Access to the image may be lost if the document's sharing settings change.
  *   `contrast` (*type:* `number()`, *default:* `nil`) - The contrast effect of the image. The value should be in the interval [-1.0, 1.0], where 0 means no effect.
  *   `cropProperties` (*type:* `GoogleApi.Docs.V1.Model.CropProperties.t`, *default:* `nil`) - The crop properties of the image.
  *   `sourceUri` (*type:* `String.t`, *default:* `nil`) - The source URI is the URI used to insert the image. The source URI can be empty.
  *   `transparency` (*type:* `number()`, *default:* `nil`) - The transparency effect of the image. The value should be in the interval [0.0, 1.0], where 0 means no effect and 1 means transparent.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :angle => number() | nil,
          :brightness => number() | nil,
          :contentUri => String.t() | nil,
          :contrast => number() | nil,
          :cropProperties => GoogleApi.Docs.V1.Model.CropProperties.t() | nil,
          :sourceUri => String.t() | nil,
          :transparency => number() | nil
        }

  field(:angle)
  field(:brightness)
  field(:contentUri)
  field(:contrast)
  field(:cropProperties, as: GoogleApi.Docs.V1.Model.CropProperties)
  field(:sourceUri)
  field(:transparency)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.ImageProperties do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.ImageProperties.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.ImageProperties do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
